/**
 * 添加板块
 */
function goAddPlate() {
	window.location.href = appServer + "/plate/add.htm";
}
/*function deleteConfirm(id) {
	$("#dialog:ui-dialog").dialog("destroy");  
	$("#msg-accountlog").show();  
	$("#dialog-confirm-checklog").dialog({  
		resizable: false,  
		height: 150,  
		modal: true,  
		close:function(event, ui) {
			$("#dialog").text("");
		},
		buttons: {  
			"确定": function () {  
				$(this).dialog("close");  
				deletePlate(id);
			},  
			"取消": function () {  
				$(this).dialog("close");  
			}  
		}  
	});  
}*/
function deleteConfirm(id) {
	var r=confirm("确认删除？");
	if (r==true){
		deletePlate(id)
	}else{
		return;
	}
}
function deletePlate(id){
	$.ajax({
		type : 'post',
		url : appServer + "/plate/delete.json",
		data : {"id":id},
		dataType:"json",
		async : false,
		cache : false,
		success : function(result) {
			console.log(result);
			if (result.errorNo != 0) {
				alert(result.errorDesc);
			} else {
				window.location.reload();
			}
		},
		error : function(XMLHttpRequest, textStatus, errorThrown) {
			$("#dialog").text("处理失败，请联系管理员！")
			$("#dialog").dialog({
				close:function(event, ui) {
					$("#dialog").text("");
				}
			});
			return;
		}
	});
}

function trimValue(obj,id) {
	//去除搜索条件的首尾空格
	$("#"+id).val(obj.trim());
}


function getGooodsList(plateId,areaCode) {
    window.open(appServer+"/plate/getGoodsList.htm?plateId="+plateId+"&areaCode="+areaCode, 'newwindow', 'height=400, width=1000, top=20,left=150, toolbar=no, menubar=no, scrollbars=yes, resizable=no,location=no, status=no').focus();
}